<div ng-if="!active && !alwaysEditable">
  <div>
    <span angular-html-bind="localValue.label"></span>
    (<a href="#" onclick="return false;" ng-click="openEditor()">Edit</a>)
  </div>
</div>

<div ng-if="active || alwaysEditable">
  <rich-text-editor html-content="localValue.label">
  </rich-text-editor>
  <button ng-if="!alwaysEditable" type="button" ng-click="replaceValue(localValue.label)">
    Close
  </button>
</div>

<script type="text/ng-template" id="modals/customizeWidget">
  <div class="modal-header">
    <h3>Customize This Widget</h3>
  </div>

  <div class="modal-body">
    <div ng-repeat="(paramName, paramSpecDict) in widgetParamSpecs">
      <strong><[paramDescriptions[paramName]]></strong>
      <value-generator-editor generator-id="paramSpecDict.generator_id"
                              init-args="paramSpecDict.init_args"
                              customization-args="widgetCustomizationArgs[paramName]"
                              obj-type="paramSpecDict.obj_type">
      </value-generator-editor>
      <br>
    </div>
  </div>

  <div class="modal-footer">
    <input type="submit" class="btn" value="Cancel"  ng-click="cancel()"/>
    <input type="submit" class="btn btn-success" value="Use these parameters" ng-click="save(widgetCustomizationArgs)"/>
  </div>
</script>
